<template>

  <div class="buy-bottom-wrapper">


    <van-goods-action>
      <van-goods-action-icon icon="service-o" text="客服"  />
      <van-goods-action-icon icon="cart-o" text="购物车" />
      <van-goods-action-button color="rgba(0,0,0,0.8)" type="warning" text="打开岘视" id="openxsflag" />
      <van-goods-action-button color="#456AFF"  @click="openShopping" type="danger" text="立即购买" />
    </van-goods-action>


<!--    <div class="contents">-->
<!--      <div class="customer-service icon-txt">-->
<!--        <span class="icon"></span>-->
<!--        <span class="txt">客服</span>-->
<!--      </div>-->
<!--      <div class="shopping-cart icon-txt">-->
<!--        <span class="icon"></span>-->
<!--        <span class="txt">购物车</span>-->
<!--      </div>-->
<!--      <div class="btns">-->
<!--        <van-button color="rgba(0,0,0,0.8)" id="openxsflag">打开岘视</van-button>-->
<!--        <van-button color="#456AFF" @click="openShopping">立即购买</van-button>-->
<!--      </div>-->
<!--    </div>-->

  </div>
</template>
<script>
export default {
  name: "CustomerService",
  data() {
    return {
      showBottom:false,
    }
  },
  mounted(){
   this.handlerinstall()
  },
  methods: {
    handlerinstall(){
      const s = document.createElement("script");
      s.type = "text/javascript";
      s.src = "//web.cdn.openinstall.io/openinstall.js";
      s.addEventListener(
          "load",
          () => {
            var data = OpenInstall.parseUrlParams();
            new OpenInstall(
                {
                  appKey: "y23dls", //appkey参数配置,需要自行替换对应的appkey
                  channelCode: "",
                  onready: function () {
                    var m = this,
                        button = document.getElementById('openxsflag');
                    m.schemeWakeup();
                    button.onclick = function () {
                      m.wakeupOrInstall();
                      return false;
                    };
                  },
                },
                data
            );
          },
          false
      );
      document.head.appendChild(s);
    },
    openShopping(){
      this.$emit("openShopping",'s');
    }
  }
}
</script>
<style scoped>
</style>